import subprocess
import os


def 清除Tamp文件():
    list_tamp = os.listdir(r"\\192.168.70.101\19计划管理部\01.计划\1，数据处理工具\file\Temp")
    for str1_tamp in list_tamp:
        os.remove(r"\\192.168.70.101\19计划管理部\01.计划\1，数据处理工具\file\Temp\\" + str1_tamp)


result = subprocess.Popen(['python', "tool_rename.py"])
result.wait()

result_库存明细账 = subprocess.Popen(['python', "tool_kcmxz.py"])
subprocess.Popen(['python', "tool_qgmxb.py"])

result = subprocess.Popen(['python', "欠料信息表.py"])
result.wait()
result = subprocess.Popen(['python', "tool_wlxxb.py"])
result.wait()

result1 = subprocess.Popen(['python', "BOM.py"])
subprocess.Popen(['python', "tool_return.py"])
result2 = subprocess.Popen(['python', "tool_tyl.py"])
result3 = subprocess.Popen(['python', "物料备货一览表.py"])
# result4 = subprocess.Popen(['python', "切换变更报表更新.py"])
result5 = subprocess.Popen(['python', r"\\192.168.70.101\19计划管理部\01.计划\1，数据处理工具\Tools\PMCtools_Python_v2.0\MC_tools\v2.0\main.py"])


if result1.wait() == 0 and result2.wait() == 0 and result3.wait() == 0 == 0 and result5.wait() == 0:
    清除Tamp文件()

if result_库存明细账.wait() == 0:
    input("运行结束，按任意键退出！")

